package com.yangcangclub.system.domain;

import com.yangcangclub.system.base.SystemBaseDomain;
import com.yangcangclub.commons.utils.DateUtil;
import com.yangcangclub.system.bean.WxEventInfo;
import org.springframework.stereotype.Component;


@Component
public class WxEvent extends SystemBaseDomain {

    public  int insertWxEvent(String toUserName,String fromUserName,String createTime,String msgType,String event,String eventKey,String ticket){

        WxEventInfo wxEventInfo = new WxEventInfo();
        wxEventInfo.setToUserName(toUserName);
        wxEventInfo.setFromUserName(fromUserName);
        wxEventInfo.setCreateTime(DateUtil.dateToStrWithTime(DateUtil.longConvertDate(Long.parseLong(createTime))));
        wxEventInfo.setMsgType(msgType);
        wxEventInfo.setEvent(event);
        wxEventInfo.setEventKey(eventKey);
        wxEventInfo.setTicket(ticket);

        super.getMasterJdbc().insert("system.SystemMapper.insertWxEvent",wxEventInfo);
        int id = wxEventInfo.getId();

        return id;
    }


}

